package data.dataStruct;

import com.google.gson.Gson;

import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;

public class Review {
    private String id;
    private String tid;
    private String title;
    private String content;

    public Review(String id,String tid,String title,String content){
        this.id=id;
        this.tid=tid;
        this.title=title;
        this.content=content;
    }

    public String getTid() {
        return tid;
    }

    public String getContent() {
        return content;
    }

    public String getTitle() {
        return title;
    }

    public String getId() {
        return id;
    }

    @Override
    public String toString() {
        Map<String,String> map=new TreeMap<>();
        map.put("rid",id);
        map.put("tid",tid);
        map.put("title",title);
        map.put("content",content);

        return new Gson().toJson(map);
    }
}
